﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;

namespace Single_SignOn.Areas.Handheld.Models
{
    public class ChangePassword
    {
        public ChangePassword()
        {
            UserName = "";
            OldPassword = "";
            NewPassword = "";
            ConfirmPassword = "";
        }

        [Required(ErrorMessage = "", ErrorMessageResourceName = "UsernameRequired", ErrorMessageResourceType = typeof(Resources.Resource))]
        [Display(Name = "Username", ResourceType = typeof(Resources.Resource))]
        [StringLength(20)]
        public string UserName { get; set; }

        [Required(ErrorMessage = "", ErrorMessageResourceName = "OldPasswordRequired", ErrorMessageResourceType = typeof(Resources.Resource))]
        [Display(Name = "OldPassword", ResourceType = typeof(Resources.Resource))]
        [DataType(DataType.Password)]
        [StringLength(100
            , MinimumLength = 1)]
        public string OldPassword { get; set; }

        [Required(ErrorMessage = "", ErrorMessageResourceName = "NewPasswordRequired", ErrorMessageResourceType = typeof(Resources.Resource))]
        [Display(Name = "NewPassword", ResourceType = typeof(Resources.Resource))]
        [DataType(DataType.Password)]
        [StringLength(100
            , MinimumLength = 1)]
        public string NewPassword { get; set; }

        [Required(ErrorMessage = "", ErrorMessageResourceName = "ConfirmPasswordRequired", ErrorMessageResourceType = typeof(Resources.Resource))]
        [Display(Name = "ConfirmNewPassword", ResourceType = typeof(Resources.Resource))]
        [DataType(DataType.Password)]
        [StringLength(100
            , MinimumLength = 1)]
        [Compare("NewPassword", ErrorMessageResourceName = "CompareConfirmPassword", ErrorMessageResourceType = typeof(Resources.Resource))]
        public string ConfirmPassword { get; set; }
    }
}